package org.grow.pointcolor;

import org.grow.pointcolor.widget.TotalFrame;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

import java.awt.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@SpringBootApplication
public class PointColor {


    public static void main(String[] args) {
        System.setProperty("java.awt.headless","false");
        ConfigurableApplicationContext ctx
                = SpringApplication.run(PointColor.class,args);
        TotalFrame window = ctx.getBean(TotalFrame.class);
        window.setVisible(true);



    }
    @Bean
    public Robot robot(){
        Robot robot = null;
        try {
            robot = new Robot();
        } catch (AWTException e) {
            e.printStackTrace();
        }
        return robot;
    }
    @Bean (name = {"es","executorService"})
    public ExecutorService executorService(){
        return Executors.newSingleThreadExecutor();
    }


}
